﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Default/Home.master" AutoEventWireup="true" CodeFile="HistoryTrans.aspx.cs" Inherits="HistoryTrans" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .auto-style1 {
        }
        .auto-style5 {
            height: 29px;
        }
        .auto-style7 {
            width: 161px;
        }
        .auto-style8 {
            width: 111px;
        }
        .auto-style9 {
            width: 138px;
        }
        .auto-style10 {
            width: 155px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentRight" runat="Server">
    &nbsp;<table border="1px" style="width:100%;">
        <tr>
            <td class="auto-style7">Trạng thái</td>
            <td class="auto-style10">
                <asp:RadioButton ID="rdAll" runat="server" GroupName="groupStatus" Text="Tất cả" />
            </td>
            <td class="auto-style9">
                <asp:RadioButton ID="rdNotComplete" runat="server" GroupName="groupStatus" Text="Chưa hoàn thành" />
            </td>
            <td class="auto-style8">
                <asp:RadioButton ID="rdComplete" runat="server" GroupName="groupStatus" Text="Hoàn thành" />
            </td>
            <td>
                <asp:RadioButton ID="rdCancel" runat="server" GroupName="groupStatus" Text="Bị Hủy" />
            </td>
        </tr>
        <tr>
            <td class="auto-style5" colspan="2">AccountID giao dịch</td>
            <td colspan="2">
                <asp:TextBox ID="txtAccountID" runat="server" Width="305px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style7">
                <asp:CheckBox ID="ckTime" runat="server" Text="Thời gian giao dịch" />
            </td>
            <td class="auto-style10">
                <asp:TextBox ID="txtFromDate" runat="server" Width="160px">From Date (yyyy-mm-dd)</asp:TextBox>
            </td>
            <td class="auto-style9">
                <asp:TextBox ID="txtToDate" runat="server" Width="199px">To Date (yyyy-mm-dd)</asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="auto-style1" colspan="3">
                <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Tìm kiếm" />
            </td>
        </tr>
    </table>
    <asp:ListView runat="server" ID="lvHistory" ItemPlaceholderID="itemLog">
        
        <LayoutTemplate>
            <table class="tbl-historytrans">
                <thead>
                    <tr>
                        <th>Mã giao dịch</th>
                        <th>Hình thức</th>
                        <th>Người gửi</th>
                        <th>Người nhận</th>
                        <th>Số tiền</th>
                        <th>Ngày thực hiện</th>
                        <th>Trạng thái</th>
                    </tr>
                </thead>
                <tbody>
                    <asp:PlaceHolder runat="server" ID="itemLog"></asp:PlaceHolder>
                </tbody>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td><%# Eval("HTID") %></td>
                <td><%# Eval("TypeTrans") %></td>
                <td><%# Eval("FromID") %></td>
                <td><%# Eval("ToID") %></td>
                <td><%# Eval("MoneyTrans", "{0:0,000 VND}") %></td>
                <td><%# Eval("DateTrans") %></td>
                <td class="status-trans"><%# Eval("Status") %></td>
            </tr>
        </ItemTemplate>

    </asp:ListView>
    <script type="text/javascript">
        var listStatus = document.getElementsByClassName("status-trans");
        for (var i = 0; i < listStatus.length; ++i) {
            elem = document.getElementsByClassName("status-trans")[i];
            if (elem.innerHTML == 0) {
                elem.innerHTML = "Chưa hoàn thành";
            } else if (elem.innerHTML == 2) {
                elem.innerHTML = "Bị hủy";
            } else {
                elem.innerHTML = "Hoàn thành";
            }
        }
    </script>
</asp:Content>

